import React from 'react';
import {connect} from "react-redux";
import { MenuFoldOutlined,MenuUnfoldOutlined } from '@ant-design/icons';
import {setCollapse} from '@/redux/modules/Menu/action'

import  '@/layouts/components/Head/index.less'
function CollapseArea(props:any) {
    let {collapse,setCollapse} = props
    const changeCollapse = () => {
        setCollapse(!collapse)
    }
    return (
        <div onClick={changeCollapse} className="preCollapse" id='id_Collapse_Area'>
            {
                collapse?<MenuUnfoldOutlined/>:<MenuFoldOutlined/>
            }
        </div>
    );
}
const mapStateToProps = (state:any)=>state.menuList;
const mapDispatchToProps = { setCollapse }
export default connect(mapStateToProps,mapDispatchToProps)(CollapseArea);
